"use strict";(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([["packages_copilot-chat_utils_copilot-local-storage_ts"],{25641:(e,t,r)=>{let s;r.d(t,{CB:()=>A,DW:()=>I,F2:()=>er,FF:()=>O,H2:()=>y,Ik:()=>q,JP:()=>G,Jz:()=>c,MB:()=>g,NJ:()=>x,OC:()=>Y,Od:()=>M,P:()=>H,Q7:()=>ee,SI:()=>J,Th:()=>X,UM:()=>et,UU:()=>U,VR:()=>_,Vb:()=>P,Vc:()=>k,XN:()=>$,Xo:()=>v,Xs:()=>w,Y6:()=>C,Ye:()=>es,Z6:()=>B,Z8:()=>N,Zs:()=>u,aX:()=>d,fG:()=>h,hV:()=>en,j$:()=>j,k4:()=>ei,lG:()=>W,lj:()=>K,mF:()=>E,mx:()=>eo,nN:()=>m,p:()=>f,pF:()=>p,qS:()=>F,rT:()=>b,vg:()=>R,x_:()=>V,yA:()=>z,yR:()=>Q,yh:()=>Z,z$:()=>L}),r(53627);var o=r(53419),i=r(25407),n=r(35247),a=r(44902),l=r(68637);let c="/copilot",_=`${c}/spaces`,u="https://github.com/features/copilot#pricing",p="https://github.com/settings/billing/budgets",g="https://github.com/settings/billing",h=50,E=20,d=5,S="For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service)",m={400:"This message could not be processed.",401:"You\u2019re not authorized to use Copilot.",403:`Access denied. You do not have permission to view this. ${S}`,404:"Resource not found. Please try again.",408:"Your network connection was interrupted. Please try again.",413:"Message too large. Please shorten it or remove some references and try again.",429:`GitHub API rate limit exceeded. Please wait and try again. ${S}`},O={extensionForbidden:"Copilot extensions can\u2019t be used in shared conversations. Please unshare the conversation and try again."},I="I'm sorry but there was an error. Please try again.";function T({status:e,path:t,method:r,error:s,requestId:i,responseBody:a}){if(n.W.capiErrorResponseTelemetry){let n={status:e,requestId:i||"",path:t,method:r,error:s};a&&(n.responseBody=a.substring(0,100)),(0,o.BI)("dotcom_chat.capi_request_error",n)}}async function f({authToken:e,basePath:t,body:r,integrationId:s,method:o,path:i,streamingResponse:n=!1,realIp:l,signal:c,apiVersion:_}){try{let u,p={Authorization:e.authorizationHeaderValue};for(let e of(s&&(p["copilot-integration-id"]=s),(0,a.f)())){let t=e.split("="),r=t[0]?.replaceAll("_","-"),s="1";t.length>1&&(s=t[1]),p[`X-Experiment-${r}`]=s}_&&(p["X-GitHub-Api-Version"]=_),n&&(p["Content-Type"]="text/event-stream"),l&&(p["X-Real-IP"]=l);let g=await fetch(t+i,{method:o,mode:"cors",cache:"no-cache",headers:p,body:JSON.stringify(r),signal:c});if(g.ok)return g;try{let e=g.clone();u=await e.text()}catch{u=void 0}return T({status:g.status,requestId:g.headers?.get("X-GitHub-Request-ID")||"",path:i,method:o,error:m[g.status]||I,responseBody:u}),{status:g.status,ok:!1,error:m[g.status]||I,response:g}}catch(e){return T({status:500,path:i,method:o,error:e instanceof Error?e.message:I}),{status:500,ok:!1,error:I}}}function C({role:e,content:t,mediaContent:r,error:s,references:o=[],thread:i,confirmationResponses:n,clientSkillConfirmations:a,clientToolResults:l,parentMessageID:c,skillOptions:_}){return{id:crypto.randomUUID(),threadID:i?.id||"temp",role:e,content:t,mediaContent:r,createdAt:new Date().toISOString(),error:s,references:o,skillExecutions:[],clientConfirmations:n,clientToolResults:l,confirmations:a,parentMessageID:c,clientSide:!0,skillOptions:_}}function A(e){return e?.name||"New chat"}function L(e){switch(e.type){case"figma":return e.title||e.url;case"file":case"folder":return D(e);case"file-diff":var t=e;let r=t.headFile?.path??t.baseFile?.path,s=r?.split("/").pop()??"";return t.selectedRange&&t.selectedRange.start?t.selectedRange.end&&t.selectedRange.start!==t.selectedRange.end?`${s} ${t.selectedRange.start}-${t.selectedRange.end}`:`${s} ${t.selectedRange.start}`:s;case"snippet":var o=e;if(o.title)return o.title;let i=o.path.split("/").pop(),n=`${o.range.start}-${o.range.end}`;return`${i}:${n}`;case"repository":return a=e,`${a.ownerLogin}/${a.name}`;case"symbol":case"docset":case"image":case"thread-scoped-file":case"thread-scoped-snippet":case"copilot-space":return e.name;case"commit":return e.message;case"pull-request":case"draft-issue":case"draft-update-issue":case"loop-node":case"web-search-result":case"loading":return e.title;case"tree-comparison":return l=e,`${l.baseRevision.substring(0,5)}..${l.headRevision.substring(0,5)}`;case"third-party":return e.displayName;case"workspace-terminal-log":return"terminal log";case"text":return e.name?e.name:"text reference";case"repo-instructions":return"copilot-instructions.md";case"issue":case"discussion":return e?.title||e.number.toString();case"org-instructions":return e?.owner;case"loop-execution":return e.loopTitle;case"job":return(c=e).jobName?`${c.jobName}`:c.repoOwner&&c.repoName?`${c.repoOwner}/${c.repoName} workflow run`:"Workflow run.";case"github-url":var a,l,c,_,u=e;let p=u.url.split("/").pop();return p?`${((_=p).charAt(0).toUpperCase()+_.slice(1)).replace("_"," ").replace("-"," ")} page`:"Previous page";case"pr-overview":return"Overview";case"pr-files-changed":return"Files changed";default:return"unrecognized reference"}}function P(e){switch(e.type){case"figma":case"web-search-result":case"github-url":return`${e.type}-${e.url}`;case"file":return`${e.type}-${e.repoOwner}/${e.repoName}@${e.commitOID}:${e.path}`;case"folder":return`${e.type}-${e.repoOwner}/${e.repoName}@${e.ref}:${e.path}`;case"file-changes":return`${e.type}-${e.repository.owner}/${e.repository.owner}@${e.ref}:${e.path}`;case"file-diff":return`${e.type}:${e.baseFile?.path}@${e.baseFile?.commitOID}-${e.headFile?.path}@${e.headFile?.commitOID}##${e.selectedRange?.start}-${e.selectedRange?.end}`;case"snippet":return`${e.type}-${e.repoOwner}/${e.repoName}@${e.commitOID}:${e.path}#${e.range.start}-${e.range.end}`;case"repository":return`${e.type}-${e.id}-${e.ownerLogin}/${e.name}`;case"symbol":return`${e.type}-${e.kind}-${e.name}`;case"docset":case"text":case"thread-scoped-file":return`${e.type}-${e.name}`;case"commit":return`${e.type}-@${e.oid}-${e.repository.owner}/${e.repository.name}`;case"pull-request":return`${e.type}-${e.id}-${e.repository.ownerLogin}/${e.repository.name}`;case"web-search":return`${e.type}-${e.query}`;case"workspace-terminal-log":return`${e.type}-${e.repoOwner}/${e.repoName}@${e.pullRequestID}`;case"repo-instructions":return`${e.type}-.github/custom-instructions.md`;case"image":return`${e.type}-${e.id}/${e.name}`;case"issue":case"discussion":return`${e.repository.owner}/${e.repository.name}#${e.number}`;case"draft-issue":case"draft-update-issue":return`${e.type}-${e.tag}`;case"thread-scoped-snippet":return`${e.type}-${e.name}-${e.range.start}-${e.range.end}`;case"loop-node":case"loading":case"job":return`${e.type}-${e.id}`;case"loop-execution":return`${e.type}-${e.executionID}`;case"copilot-space":return`${e.type}`;default:return""}}let R=()=>s??(s=new Set(["commit","discussion","figma","file","file-v2","file-diff","folder","issue","job","draft-issue","draft-update-issue","pull-request","org-instructions","repo-instructions","snippet","symbol","third-party","web-search","web-search-result","image","thread-scoped-file","thread-scoped-snippet","loading","loop-node","repository","docset","copilot-space","loop-execution","github-url"]));function y(e){return e.filter(e=>"third-party-mcp-tool-result"===e.type)}function b(e){let t=[];for(let r of e??[])if(R().has(r.type)){if("web-search"===r.type){for(let e of r.results){let r={...e,type:"web-search-result"};t.push(r)}continue}t.push(r)}return t}function G(e){switch(e.type){case"repository":return`/${e.ownerLogin}/${e.name}`;case"commit":return e.permalink;case"third-party":return e.displayUrl;case"snippet":if(("file"===e.type||"snippet"===e.type)&&e.languageName&&"markdown"===e.languageName.toLowerCase()){let t=new URL(e.url,window.location.origin);return t.search="plain=1",t.href}return e.url;case"job":var t;return((t=e).jobUrl?t.jobUrl:t.repoOwner&&t.repoName&&t.workflow?["",t.repoOwner,t.repoName,"actions","runs",t.workflow.id,"job",t.id].map(encodeURIComponent).join("/"):void 0)??"#";case"loop-node":return e.url??"#";case"loop-execution":return`/copilot/l/${e.loopID}?version=${e.version}`;case"issue":case"figma":case"file":case"file-diff":case"folder":case"pull-request":case"discussion":case"repo-instructions":case"org-instructions":case"web-search-result":case"github-url":return e.url;default:return"#"}}function w(e){return"#"!==e&&""!==e}function N(e){let t=e.path.split("/");return(t.pop(),0===t.length)?"/":t.join("/")}function v(e){return D(e)}function D(e){return e.path.split("/").pop()||e.path}function M(e,t){return{type:"file",url:new URL((0,i.IO9)({repo:t,commitish:t.refInfo.name,action:"blob",path:e}),window.location.origin).href,path:e,repoID:t.id,repoOwner:t.ownerLogin,repoName:t.name,ref:t.ref,commitOID:t.commitOID}}function $(e,t,r){return{...M(e,r),type:"snippet",range:{start:t.start,end:t.end}}}function k(e){return{id:crypto.randomUUID(),title:e,type:"loading",isClientOnly:!0}}function Y(e,t){return{type:"folder",url:new URL((0,i.IO9)({repo:t,commitish:t.refInfo.name,action:"tree",path:e}),window.location.origin).href,path:e,repoID:t.id,repoOwner:t.ownerLogin,repoName:t.name,ref:t.ref}}function U(e){return{...e,type:"docset"}}function F(e){return{...e,type:"repository"}}function K(e){return{owner:`${e} Instructions`,type:"org-instructions",url:"https://docs.github.com/en/copilot/customizing-copilot/adding-organization-custom-instructions-for-github-copilot"}}function q(e,t,r){return{type:"loop-node",id:e,title:t,url:r}}function H(e){return!!e&&"sourceRepos"in e}function B(e){return!!e&&!H(e)}function x(e){return e.reduce((e,t)=>("customInstructions"in t&&Array.isArray(t.customInstructions)&&e.push(...t.customInstructions),e),[])}function W(e,t){return x(t).length>0}function j(e){return x(e).map(e=>e.owner).join(",")}function V(e,t){return e===t||void 0!==e&&void 0!==t&&P(e)===P(t)}function Q(e,t){if(void 0===e&&void 0===t)return!0;if(void 0===e||void 0===t||e.length!==t.length)return!1;for(let r=0;r"github.agent"===e.type);if(t)return{name:t.login,avatarURL:t.avatarURL,type:"agent"}}return{name:"Copilot",avatarURL:"",type:"copilot"}}function Z(e){return"agent"===e.type}function ee(e){let t=e.map(e=>X(e,"")).filter(e=>e?.type==="agent"),r=new Map;for(let e of t)r.set(e.name,e);return Array.from(r.values())}function et(e){return e.some(e=>e.references?.some(e=>"third-party-mcp-tool-result"===e.type)??!1)}function er(e){let t=new Date(e.updatedAt).getTime();return Date.now()-t>144e5}function es(e){if(!e)return[];let t=new Set;return e.filter(e=>{let r=JSON.stringify(e.confirmation);return!t.has(r)&&(t.add(r),!0)})}function eo(e){let t="type"in e&&"string"==typeof e.type?e.type:"repository",r=t?t.replace(/(\.api|-v2)$/,"").toLowerCase():"default";return{referenceType:t,suggestions:ei(l.y$[r]||l.y$.default).slice(0,3)}}function ei(e){let t=e.slice();for(let e=t.length-1;e>0;e--){let r=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[r],t[r]=s}return t}function en(e,t){let r=t.split(" "),s=`${e} said`;return"Timeline"===e&&(s="The following action was initiated"),`${s}: ${r.slice(0,r.length<7?r.length:7).join(" ")}`}},35247:(e,t,r)=>{r.d(t,{W:()=>o});var s=r(69599);let o=new class CopilotFeatureFlags{get immersiveFigmaIntegration(){return(0,s.G7)("copilot_immersive_figma_integration")}get planningAgent(){return(0,s.G7)("copilot_immersive_planning_agent")}get draftIssuesWithDependencies(){return(0,s.G7)("copilot_api_draft_issues_with_dependencies")}get focusTextAreaInsteadOfWorkbench(){return(0,s.G7)("copilot_focus_text_area_instead_of_workbench")}get forceLegacyChatDefaultModel(){return(0,s.G7)("copilot_api_force_legacy_base_chat_model")}get draftUpdateIssue(){return(0,s.G7)("copilot_api_github_draft_update_issue_skill")}get domPageContext(){return(0,s.G7)("copilot_use_dom_page_context")}get copilotChatInterviewSurvey(){return(0,s.G7)("copilot_chat_interview_survey")}get attachMultipleImages(){return(0,s.G7)("copilot_chat_attach_multiple_images")}get selectionAttachments(){return(0,s.G7)("copilot_chat_selection_attachments")}get customCopilots(){return(0,s.G7)("copilot_custom_copilots")}get immersiveStructuredModelPicker(){return(0,s.G7)("copilot_immersive_structured_model_picker")}get customCopilotsFeaturePreview(){return(0,s.G7)("copilot_custom_copilots_feature_preview")}get clientDOMSkills(){return(0,s.G7)("copilot_client_dom_skills")}get dotcomChatClientSideSkills(){return(0,s.G7)("dotcom_chat_client_side_skills")}get loopsPlugin(){return(0,s.G7)("copilot_pipes")}get workbenchPlugin(){return(0,s.G7)("copilot_workbench")}get copilotChatOpeningThreadSwitch(){return(0,s.G7)("copilot_chat_opening_thread_switch")}get copilotReadSharedConversation(){return(0,s.G7)("copilot_read_shared_conversation")}get copilotDuplicateThread(){return(0,s.G7)("copilot_duplicate_thread")}get copilotShareActiveSubthread(){return(0,s.G7)("copilot_share_active_subthread")}get copilotChatO1Tools(){return(0,s.G7)("copilot_api_tools_for_non_streaming_models")}get showDeepCodeSearchButton(){return(0,s.G7)("copilot_show_deep_code_search_button")&&(0,s.G7)("copilot_api_search_agent_skill")}get deleteAllConversations(){return(0,s.G7)("copilot_delete_all_conversations")}get staffPromptDialog(){return(0,s.G7)("copilot_staff_prompt_dialog")}get workbenchTerminal(){return(0,s.G7)("copilot_workbench_terminal")}get workbenchPreviewAnalytics(){return(0,s.G7)("copilot_workbench_preview_analytics")}get workbenchShowConnectionReloadBanner(){return(0,s.G7)("copilot_workbench_connection_reload_banner")}get visionAllowedInClaude(){return(0,s.G7)("copilot_chat_vision_in_claude")}get visionSkipThreadCreate(){return(0,s.G7)("copilot_chat_vision_skip_thread_create")}get premiumRequestQuotasEnabled(){return(0,s.G7)("copilot_premium_request_quotas")}get freeToPaidTelemetry(){return(0,s.G7)("copilot_free_to_paid_telem")}get freeToPaidSettingsUpgrade(){return(0,s.G7)("copilot_ftp_settings_upgrade")}get freeToPaidYourCopilotSettings(){return(0,s.G7)("copilot_ftp_your_copilot_settings")}get freeToPaidUpgradeToProFromModels(){return(0,s.G7)("copilot_ftp_upgrade_to_pro_from_models")}get spacesImagesEnabled(){return(0,s.G7)("copilot_custom_copilots_images")}get knowledgeBasesDisabled(){return(0,s.G7)("kb_sunset")&&!(0,s.G7)("kb_sunset_override")}get immersiveJobResultPreview(){return(0,s.G7)("copilot_immersive_job_result_preview")}get copilotPersistEditedDraftIssues(){return(0,s.G7)("copilot_immersive_draft_issue_persist_edited_issues_in_session")}get sparkUseBillingHeaders(){return(0,s.G7)("copilot_spark_use_billing_headers")}get copilotThirdPartyMcp(){return(0,s.G7)("copilot_api_dotcom_chat_use_third_party_mcp_servers")}get disableModelPickerWhileStreaming(){return(0,s.G7)("copilot_chat_disable_model_picker_while_streaming")}get sparkSyncRepositoryAfterIteration(){return(0,s.G7)("spark_sync_repository_after_iteration")}get sparkUseSeparateSuggestionArgs(){return(0,s.G7)("copilot_spark_use_separate_suggestion_args")}get freeToPaidHyperspaceUpgradePrompt(){return(0,s.G7)("copilot_ftp_hyperspace_upgrade_prompt")}get reduceChatQuotaChecks(){return(0,s.G7)("copilot_chat_reduce_quota_checks")}get kbSemanticApiMigration(){return(0,s.G7)("kb_semantic_api_migration")}get requestTracing(){return(0,s.G7)("copilot_api_staff_only_tracing")}get coffeTraceViewer(){return(0,s.G7)("copilot_coffe_trace_view_enabled")}get copilotSpacesReadAccessToUserOwnedSpaces(){return(0,s.G7)("copilot_spaces_read_access_to_user_owned_spaces")}get copilotSpacesPublicAccessToUserOwnedSpaces(){return(0,s.G7)("copilot_spaces_public_access_to_user_owned_spaces")}get copilotSpacesReportAbuse(){return(0,s.G7)("copilot_spaces_report_abuse")}get copilotWorkbenchAgentSeedTool(){return(0,s.G7)("copilot_workbench_agent_seed_tool")}get capiErrorResponseTelemetry(){return(0,s.G7)("copilot_capi_error_response_telemetry")}get sparkWriteIterationHistoryToGit(){return(0,s.G7)("copilot_spark_write_iteration_history_to_git")}get sparkReadIterationHistoryFromGit(){return(0,s.G7)("copilot_spark_read_iteration_history_from_git")}get sparkReadIterationHistoryFromGitV2(){return(0,s.G7)("copilot_spark_read_iteration_history_from_git_v2")}get copilotWorkbenchCache(){return(0,s.G7)("copilot_workbench_cache")}get sparkUseNewDataLayer(){return(0,s.G7)("copilot_spark_new_data_layer")}get sparkIteratePanelChat(){return(0,s.G7)("copilot_spark_iterate_panel_chat")}get enableGenerateSummaryTool(){return(0,s.G7)("copilot_spark_iterate_panel_chat")}get sparkUseProgressiveErrorHandling(){return(0,s.G7)("copilot_spark_progressive_error_handling")}get sparkLoadingWebGL(){return(0,s.G7)("copilot_spark_loading_webgl")}get fileBlockRefMatching(){return(0,s.G7)("copilot_file_block_ref_matching")}get stableConversationView(){return(0,s.G7)("copilot_stable_conversation_view")}get copilotRedirectDiffViewToImmersive(){return(0,s.G7)("copilot_chat_diff_view_redirect")}get copilotRedirectFileViewToImmersive(){return(0,s.G7)("copilot_chat_file_redirect")}get copilotRedirectSnippetToImmersive(){return(0,s.G7)("copilot_chat_snippet_redirect")}get mcpToolDescriptions(){return(0,s.G7)("copilot_mcp_tool_descriptions")}get copilotWorkbenchUseSinglePrompt(){return(0,s.G7)("copilot_workbench_use_single_prompt")}get copilotResourcePanel(){return(0,s.G7)("copilot_resource_panel")}get spacesAsAttachmentsEnabled(){return(0,s.G7)("copilot_spaces_as_attachments")}get spacesIndividualRestrictedOrgContent(){return(0,s.G7)("copilot_spaces_individual_restricted_org_content")}get loopExecutionReferences(){return(0,s.G7)("loops_execution_references")}get loopsAbusePrevention(){return(0,s.G7)("loops_abuse_prevention")}get convertToSpaceEnabled(){return(0,s.G7)("kb_convert_to_space")}get copilotWorkbenchShowPreviewTool(){return(0,s.G7)("copilot_workbench_show_preview_tool")}get sweAgentUseSubagents(){return(0,s.G7)("copilot_swe_agent_use_subagents")}get chatInputCommands(){return(0,s.G7)("copilot_chat_input_commands")}get agentTaskListV2(){return(0,s.G7)("copilot_agent_task_list_v2")}get removeAssistiveChatButton(){return(0,s.G7)("copilot_chat_remove_assistive_button")}get hideExtensionsInDotcomChat(){return(0,s.G7)("copilot_extensions_hide_in_dotcom_chat")}get copilotSearchBarRedirect(){return(0,s.G7)("copilot_chat_search_bar_redirect")}get taskWithinChatThread(){return(0,s.G7)("copilot_immersive_task_within_chat_thread")}}},44902:(e,t,r)=>{r.d(t,{R:()=>n,f:()=>i});var s=r(82075);let o="copilot_experiments";function i(){let e=(0,s.A)("localStorage").getItem(o);return e?e.split(","):[]}function n(e){(0,s.A)("localStorage").setItem(o,e.join(","))}},51213:(e,t,r)=>{r.d(t,{C6:()=>o,UH:()=>l,Wp:()=>c,hs:()=>n,mF:()=>a,wh:()=>s,xP:()=>i});let s={explain:"explain",conversation:"conversation",suggest:"suggest",discussFileDiff:"discuss-file-diff",explainFileDiff:"explain-file-diff",reviewPr:"review-pull-request",actionsAgent:"actions-agent",planningAgent:"planning-agent"},o=["exception","filtered","publicCode","contentTooLarge","rateLimit","agentUnauthorized","agentRequest","networkError","multipleAgentsAttempt"],i=["bing-search","codesearch","semantic-code-search","lexical-code-search","kb-search","getfile","getfilechanges","getdiscussion","get-actions-job-logs","getalert","planskill","get-github-data","support-search","get-figma","codesearchagentskill","github-draft-issue.draft-issue","github-draft-issue.existing-issue","github-draft-issue.repository-metadata","github-draft-issue.get-issues","github-coding-agent-","github-coding-agent"],n={Experiments:"experiements",Prompt:"prompt",None:"none"},a={Unlicensed:"unlicensed",LicensedFull:"licensed_full",LicensedLimited:"licensed_limited"},l={IndividualFree:"free",IndividualPro:"pro",IndividualProPlus:"pro_plus",Business:"business",Enterprise:"enterprise"},c="NULL_MESSAGE"},68637:(e,t,r)=>{r.d(t,{Pe:()=>i,oo:()=>o,y$:()=>n});var s=r(51213);function o(e,t=!1){let r=null!=e?`failing job ${e}`:"this failing job";return`Please find a solution for ${r}. ${t?"Use the provided reference to fetch the job logs. Use the logs, job definition, and any referenced files where the failure occurred.":"Use the logs, job definition, and any referenced files where the failure occurred."} Keep your response focused on the solution and include code suggestions when appropriate.`}let i={"Languages & frameworks":["Show me Python beginner projects.","Explain Java's garbage collection.","Start me off with Node.js.","Introduce me to Django best practices."],"Tools & environments":["Set up a local development environment.","Demonstrate the basics of Docker.","Get me started with Git.","Recommend popular VS Code extensions."],"Open source & contribution":["Suggest 10 open source projects I can contribute to.","Walk me through the GitHub Pull Request flow.","How do I start my own open source project?","Guide me through contributing to React's codebase."],"Best practices & concepts":["Explain the SOLID principles of object-oriented design.","Introduce me to test-driven development.","Describe common design patterns.","Teach me about RESTful API design."],"Web development":["Guide me through creating a basic website.","Introduce HTML5 and CSS3 features.","Explain responsive web design.","Start me off with Tailwind CSS."],"Databases & data":["Get me started with SQL queries.","Recommend popular NoSQL databases.","How to back up a database?","Give a walkthrough on normalizing a database."],"Algorithms & data structures":["Teach me basic sorting algorithms.","Explain binary search trees.","Introduce me to graph algorithms.","What is a hash table?"],"Security & authentication":["Give a guide on basic web security.","Show me how to set up OAuth.","What's a JSON Web Token?","Describe common encryption techniques."],"Mobile development":["Kickstart my journey with Android development.","Introduce me to iOS app basics.","Recommend cross-platform mobile frameworks.","Give a guide to the app store submission process."],"Cloud & DevOps":["Start me off with AWS basics.","How do I deploy apps on Azure DevOps?","Introduce me to Kubernetes.","What are the basics of continuous integration/continuous deployment?"],"Frontend frameworks & libraries":["Get me started with React.","Walk me through Vue.js essentials.","What are some best practices in Angular development?","How do I use Svelte for web apps?"],"Performance & optimization":["Teach me about website performance optimization.","Explain database indexing benefits.","What are some tips to optimize JavaScript code?","Give a guide to efficient API caching."]},n={repository:[{question:"What questions can I ask?"},{question:"What does this repository do?"},{question:"How should I get started exploring this repo?"},{question:"Can you tell me about this repository?"}],issue:[{question:"Summarize this issue."},{question:"What are the main points being discussed here?"},{question:"Suggest next steps for this issue."}],alert:[{question:"Summarize this alert."}],file:[{question:"Explain this file."},{question:"Summarize this file for me."},{question:"How can I improve this file?"}],"pull-request":[{question:"Summarize this pull request."},{question:"What commits are included in this PR?"},{question:"Can you tell me about the changes in this PR?"}],discussion:[{question:"Summarize this discussion."},{question:"Summarize the comments made by user in a discussion."},{question:"What were some key decisions made in this discussion?"}],job:[{question:"Why did this job fail?",intent:s.wh.actionsAgent},{question:"How can I fix this build?",intent:s.wh.actionsAgent}],default:[{question:"What questions can I ask?"},{question:"What is the best way to get started with Copilot?"},{question:"How do I clone this repository?"},{question:"How do I revert a commit?"},{question:"How do I add myself as a reviewer?"},{question:"How do I create a repository?"}],issues:[{question:"How do I create an issue?"},{question:"How do I filter issues by label?"},{question:"What are the most recently updated issues?"}],"pull-requests":[{question:"How do I create a pull request?"},{question:"How do I filter pull requests by label?"},{question:"How do I reopen a closed pull request?"}],discussions:[{question:"How do I start a new discussion?"},{question:"How do I filter discussions by category or tag?"},{question:"How do I search for a specific discussion?"}]}},79064:(e,t,r)=>{r.d(t,{Jt:()=>_,iI:()=>u});var s=r(50467),o=r(31635),i=r(21728),n=r(45062),a=r(82075),l=r(96540),c=r(25641);let CopilotLocalStorage=class CopilotLocalStorage{get selectedThreadID(){return this.localStorage.getItem(this.COPILOT_SELECTED_THREAD_ID_STORAGE_KEY)}set selectedThreadID(e){let t=this.COPILOT_SELECTED_THREAD_ID_STORAGE_KEY;if(null==e)return void this.localStorage.removeItem(t);this.localStorage.setItem(t,e)}getModel(e){let t=this.localStorage.getItem(this.COPILOT_SELECTED_MODEL_STORAGE_KEY(e));return null===t?t:JSON.parse(t)}setModel(e,t){this.localStorage.setItem(this.COPILOT_SELECTED_MODEL_STORAGE_KEY(e),JSON.stringify(t)),e&&this.localStorage.setItem(this.COPILOT_SELECTED_MODEL_STORAGE_KEY(null),JSON.stringify(t))}get settings(){let e=this.localStorage.getItem(this.COPILOT_SETTINGS_STORAGE_KEY(this.selectedThreadID));return null===e?e:JSON.parse(e)}set settings(e){this.localStorage.setItem(this.COPILOT_SETTINGS_STORAGE_KEY(this.selectedThreadID),JSON.stringify(e))}getPanelHeight(){let e=this.localStorage.getItem(this.COPILOT_PANEL_HEIGHT);return e?parseInt(e):this.DEFAULT_PANEL_HEIGHT}setPanelHeight(e){let t=this.COPILOT_PANEL_HEIGHT;this.localStorage.setItem(t,e.toString())}getPanelWidth(){let e=this.localStorage.getItem(this.COPILOT_PANEL_WIDTH);return e?parseInt(e):this.DEFAULT_PANEL_WIDTH}setPanelWidth(e){let t=this.COPILOT_PANEL_WIDTH;this.localStorage.setItem(t,e.toString())}getRepoCustomInstructionsState(){return"false"!==this.localStorage.getItem(this.COPILOT_REPO_CUSTOM_INSTRUCTIONS_STATE_KEY)}setRepoCustomInstructionsState(e){let t=this.COPILOT_REPO_CUSTOM_INSTRUCTIONS_STATE_KEY;this.localStorage.setItem(t,e.toString())}getCollapsedState(){return"false"!==this.sessionStorage.getItem(this.COPILOT_COLLAPSED_STATE_KEY)}setCollapsedState(e){let t=this.COPILOT_COLLAPSED_STATE_KEY;this.sessionStorage.setItem(t,e.toString())}getSelectedTopic(e){return this.localStorage.getItem(this.COPILOT_SELECTED_TOPIC_STORAGE_KEY(e))}setSelectedTopic(e,t){if(null==t)return void this.localStorage.removeItem(this.COPILOT_SELECTED_TOPIC_STORAGE_KEY(e));let r=this.COPILOT_SELECTED_TOPIC_STORAGE_KEY(e);this.localStorage.setItem(r,t)}getSavedMessage(e){return this.localStorage.getItem(this.COPILOT_SAVED_USER_MESSAGE_KEY(e))}setSavedMessage(e,t){this.setSavedMessageFast(e,t)}setSavedMessageFast(e,t){let r=this.COPILOT_SAVED_USER_MESSAGE_KEY(e);if(null==t)return void this.localStorage.removeItem(r);this.localStorage.setItem(r,t)}clearSavedUserMessage(e){this.localStorage.removeItem(this.COPILOT_SAVED_USER_MESSAGE_KEY(e))}getSavedUserMessageOnError(e){return this.localStorage.getItem(this.COPILOT_SAVED_USER_MESSAGE_ON_ERROR_KEY(e))}setSavedUserMessageOnError(e,t){let r=this.COPILOT_SAVED_USER_MESSAGE_ON_ERROR_KEY(e);if(null==t)return void this.localStorage.removeItem(r);this.localStorage.setItem(r,t)}clearSavedUserMessageOnError(e){this.localStorage.removeItem(this.COPILOT_SAVED_USER_MESSAGE_ON_ERROR_KEY(e))}getEntrypointMessage(e){let t,r=e||this.COPILOT_ENTRYPOINT_MESSAGE_KEY,s=this.localStorage.getItem(r);if(null==s)return null;try{t=s.startsWith("{")?JSON.parse(s):void 0}catch{}return t&&void 0!==t.message?{message:t.message,references:t.references,model:t.model}:{message:s,references:void 0}}setEntrypointMessage(e,t,r,s){let o=s||this.COPILOT_ENTRYPOINT_MESSAGE_KEY;if(null==e)return void this.localStorage.removeItem(o);this.localStorage.setItem(o,JSON.stringify({message:e,references:t,model:r}))}getTaskEntrypointMessage(){return this.getEntrypointMessage(this.COPILOT_TASK_ENTRYPOINT_MESSAGE_KEY)}setTaskEntrypointMessage(e,t){this.setEntrypointMessage(e,t,void 0,this.COPILOT_TASK_ENTRYPOINT_MESSAGE_KEY)}getLoopEntrypointMessage(){return this.getEntrypointMessage(this.COPILOT_LOOP_ENTRYPOINT_MESSAGE_KEY)}setLoopEntrypointMessage(e,t){this.setEntrypointMessage(e,t,void 0,this.COPILOT_LOOP_ENTRYPOINT_MESSAGE_KEY)}getSparkEntrypointMessage(){return this.getEntrypointMessage(this.COPILOT_SPARK_ENTRYPOINT_MESSAGE_KEY)}setSparkEntrypointMessage(e){this.setEntrypointMessage(e,void 0,void 0,this.COPILOT_SPARK_ENTRYPOINT_MESSAGE_KEY)}getLastUsedRepository(){let e=this.localStorage.getItem(this.COPILOT_LAST_USED_REPOSITORY_KEY);if(!e)return null;try{return JSON.parse(e)}catch{return null}}setLastUsedRepository(e){this.localStorage.setItem(this.COPILOT_LAST_USED_REPOSITORY_KEY,JSON.stringify(e))}getCurrentReferences(e){let t=this.COPILOT_CURRENT_REFERENCES_KEY(e),r=this.localStorage.getItem(t);return r?JSON.parse(r):null}setCurrentReferences(e,t){let r=this.COPILOT_CURRENT_REFERENCES_KEY(e),s=t.filter((e,r)=>r===t.findIndex(t=>(0,c.Vb)(e)===(0,c.Vb)(t)));this.localStorage.setItem(r,JSON.stringify(s))}clearCurrentReferences(e){let t=this.COPILOT_CURRENT_REFERENCES_KEY(e);this.localStorage.removeItem(t)}migrateNullThreadToNewThread(e){let t=this.getSavedMessage(null);this.setSavedMessageFast(null,null),t&&this.setSavedMessageFast(e,t);let r=this.getCurrentReferences(null);this.clearCurrentReferences(null),r&&this.setCurrentReferences(e,r)}getImmersiveSidebarCollapsedState(){let e=this.localStorage.getItem(this.COPILOT_IMMERSIVE_SIDEBAR_COLLAPSED_STATE_KEY);return null===e||"true"===e}setImmersiveSidebarCollapsedState(e){this.localStorage.setItem(this.COPILOT_IMMERSIVE_SIDEBAR_COLLAPSED_STATE_KEY,String(e))}getCopilotDiffReferences(){let e=this.localStorage.getItem(this.COPILOT_DIFF_REFERENCES_KEY);return e?JSON.parse(e):null}setCopilotDiffReferences(e){let t=Array.isArray(e)?e:[e];this.localStorage.setItem(this.COPILOT_DIFF_REFERENCES_KEY,JSON.stringify(t))}removeCopilotDiffReferences(){this.localStorage.removeItem(this.COPILOT_DIFF_REFERENCES_KEY)}getMeterBannerFlag(){let e=this.localStorage.getItem(this.COPILOT_METER_BANNER_FLAG);return null===e?null:"true"===e}setMeterBannerFlag(e){this.localStorage.setItem(this.COPILOT_METER_BANNER_FLAG,String(e))}removeMeterBannerFlag(){this.localStorage.removeItem(this.COPILOT_METER_BANNER_FLAG)}getQuotaExceededBannerFlag(){let e=this.tempStorage.getItem(this.COPILOT_QUOTA_EXCEEDED_BANNER_FLAG);return null===e?null:"true"===e}setQuotaExceededBannerFlag(e){this.tempStorage.setItem(this.COPILOT_QUOTA_EXCEEDED_BANNER_FLAG,String(e))}removeQuotaExceededBannerFlag(){this.tempStorage.removeItem(this.COPILOT_QUOTA_EXCEEDED_BANNER_FLAG)}getSkuSuccessBannerFlag(e){return this.getBooleanFlag(this.skuSuccessBannerKey(e))}setSkuSuccessBannerFlag(e,t){this.tempStorage.setItem(this.skuSuccessBannerKey(e),String(t))}removeSkuSuccessBannerFlag(e){this.tempStorage.removeItem(this.skuSuccessBannerKey(e))}getAnimationFlag(){return this.getBooleanFlag(this.COPILOT_ANIMATION_FLAG)}setAnimationFlag(e){this.tempStorage.setItem(this.COPILOT_ANIMATION_FLAG,String(e))}removeAnimationFlag(){this.tempStorage.removeItem(this.COPILOT_ANIMATION_FLAG)}getTracingRequestedFlag(){return"true"===this.localStorage.getItem(this.COPILOT_TRACING_REQUESTED_FLAG)}setTracingRequestedFlag(e){this.localStorage.setItem(this.COPILOT_TRACING_REQUESTED_FLAG,String(e))}getWrapCodeLines(){return"true"===this.localStorage.getItem(this.COPILOT_WRAP_CODE_LINES_KEY)}setWrapCodeLines(e){this.localStorage.setItem(this.COPILOT_WRAP_CODE_LINES_KEY,String(e))}getBooleanFlag(e,t=this.tempStorage){let r=t.getItem(e);return null===r?null:"true"===r}getSpacesMcpBannerDismissalCount(){let e=this.localStorage.getItem(this.COPILOT_SPACES_MCP_BANNER_DISMISSAL_COUNT);return e?parseInt(e,10):0}setSpacesMcpBannerDismissalCount(e){let t=this.COPILOT_SPACES_MCP_BANNER_DISMISSAL_COUNT;this.localStorage.setItem(t,e.toString())}getSpacesSelectedTab(){return this.localStorage.getItem(this.COPILOT_SPACES_SELECTED_TAB)||"personal"}setSpacesSelectedTab(e){let t=this.COPILOT_SPACES_SELECTED_TAB;this.localStorage.setItem(t,e)}skuSuccessBannerKey(e){return`COPILOT_${e.toUpperCase()}_SUCCESS_BANNER_FLAG`}retrieveAndValidateRequestIDs(){let e=this.localStorage.getItem(this.COPILOT_MESSAGE_REQUEST_ID_KEY);try{let t=JSON.parse(e||"[]");if(!Array.isArray(t)||0===t.length)return[];return t.filter(e=>"string"==typeof e.messageID&&"string"==typeof e.requestID)}catch{return[]}}addRequestID(e,t){let r=this.retrieveAndValidateRequestIDs(),s=r.findIndex(t=>t.messageID===e);-1!==s&&r.splice(s,1),r.push({messageID:e,requestID:t}),r.length>this.MAX_MESSAGE_REQUEST_ID_STORAGE_COUNT&&r.shift(),this.localStorage.setItem(this.COPILOT_MESSAGE_REQUEST_ID_KEY,JSON.stringify(r))}getRequestID(e){let t=this.retrieveAndValidateRequestIDs().find(t=>t.messageID===e);return t?t.requestID:void 0}constructor(){(0,s._)(this,"COPILOT_REPO_CUSTOM_INSTRUCTIONS_STATE_KEY","COPILOT_REPO_CUSTOM_INSTRUCTIONS_STATE_KEY"),(0,s._)(this,"COPILOT_SELECTED_THREAD_ID_STORAGE_KEY","COPILOT_SELECTED_THREAD_ID_STORAGE_KEY"),(0,s._)(this,"COPILOT_COLLAPSED_STATE_KEY","COPILOT_COLLAPSED_STATE_KEY"),(0,s._)(this,"COPILOT_IMMERSIVE_SIDEBAR_COLLAPSED_STATE_KEY","COPILOT_IMMERSIVE_SIDEBAR_COLLAPSED_STATE_KEY"),(0,s._)(this,"COPILOT_PANEL_HEIGHT","COPILOT_PANEL_HEIGHT"),(0,s._)(this,"DEFAULT_PANEL_HEIGHT",600),(0,s._)(this,"COPILOT_PANEL_WIDTH","COPILOT_PANEL_WIDTH"),(0,s._)(this,"COPILOT_ENTRYPOINT_MESSAGE_KEY","COPILOT_ENTRYPOINT_MESSAGE_KEY"),(0,s._)(this,"COPILOT_TASK_ENTRYPOINT_MESSAGE_KEY","COPILOT_TASK_ENTRYPOINT_MESSAGE_KEY"),(0,s._)(this,"COPILOT_LOOP_ENTRYPOINT_MESSAGE_KEY","COPILOT_LOOP_ENTRYPOINT_MESSAGE_KEY"),(0,s._)(this,"COPILOT_SPARK_ENTRYPOINT_MESSAGE_KEY","COPILOT_SPARK_ENTRYPOINT_MESSAGE_KEY"),(0,s._)(this,"COPILOT_MESSAGE_REQUEST_ID_KEY","COPILOT_MESSAGE_REQUEST_ID_KEY"),(0,s._)(this,"COPILOT_METER_BANNER_FLAG","COPILOT_METER_BANNER_FLAG"),(0,s._)(this,"COPILOT_QUOTA_EXCEEDED_BANNER_FLAG","COPILOT_QUOTA_EXCEEDED_BANNER_FLAG"),(0,s._)(this,"COPILOT_ANIMATION_FLAG","COPILOT_ANIMATION_FLAG"),(0,s._)(this,"COPILOT_WRAP_CODE_LINES_KEY","COPILOT_WRAP_CODE_LINES_KEY"),(0,s._)(this,"COPILOT_TRACING_REQUESTED_FLAG","COPILOT_TRACING_REQUESTED_FLAG"),(0,s._)(this,"COPILOT_DIFF_REFERENCES_KEY","COPILOT_DIFF_REFERENCES_KEY"),(0,s._)(this,"COPILOT_SNIPPET_REFERENCE_KEY","COPILOT_SNIPPET_REFERENCE_KEY"),(0,s._)(this,"COPILOT_SPACES_MCP_BANNER_DISMISSAL_COUNT","COPILOT_SPACES_MCP_BANNER_DISMISSAL_COUNT"),(0,s._)(this,"COPILOT_SPACES_SELECTED_TAB","COPILOT_SPACES_SELECTED_TAB"),(0,s._)(this,"COPILOT_LAST_USED_REPOSITORY_KEY","COPILOT_LAST_USED_REPOSITORY_KEY"),(0,s._)(this,"MAX_MESSAGE_REQUEST_ID_STORAGE_COUNT",100),(0,s._)(this,"DEFAULT_PANEL_WIDTH",480),(0,s._)(this,"COPILOT_SELECTED_MODEL_STORAGE_KEY",e=>`COPILOT_SELECTED_MODEL_${e}`),(0,s._)(this,"COPILOT_SETTINGS_STORAGE_KEY",e=>`COPILOT_SETTINGS_${e}`),(0,s._)(this,"COPILOT_SAVED_USER_MESSAGE_KEY",e=>`COPILOT_SAVED_USER_MESSAGE_${e}`),(0,s._)(this,"COPILOT_SAVED_USER_MESSAGE_ON_ERROR_KEY",e=>`COPILOT_SAVED_USER_MESSAGE_ON_ERROR_${e}`),(0,s._)(this,"COPILOT_CURRENT_REFERENCES_KEY",e=>`COPILOT_CURRENT_REFERENCES_${e}`),(0,s._)(this,"COPILOT_SELECTED_TOPIC_STORAGE_KEY",e=>`COPILOT_SELECTED_TOPIC_${e}`),(0,s._)(this,"localStorage",(0,a.A)("localStorage",{throwQuotaErrorsOnSet:!1,ttl:864e5})),(0,s._)(this,"longStorage",(0,a.A)("localStorage",{throwQuotaErrorsOnSet:!1})),(0,s._)(this,"tempStorage",(0,a.A)("localStorage",{throwQuotaErrorsOnSet:!1,ttl:18e5})),(0,s._)(this,"sessionStorage",(0,a.A)("sessionStorage",{throwQuotaErrorsOnSet:!1,ttl:864e5}))}};(0,o.Cg)([(0,n.s)(100)],CopilotLocalStorage.prototype,"setSavedMessage",null);let _=new CopilotLocalStorage;function u(e,t){let r,s,o,n=(0,i.c)(7);n[0]!==e?(r=()=>_[e](),n[0]=e,n[1]=r):r=n[1];let[a,c]=(0,l.useState)(r);n[2]!==t?(s=e=>{_[t](e),c(e)},n[2]=t,n[3]=s):s=n[3];let u=s;return n[4]!==a||n[5]!==u?(o=[a,u],n[4]=a,n[5]=u,n[6]=o):o=n[6],o}}}]); //# sourceMappingURL=packages_copilot-chat_utils_copilot-local-storage_ts-2420dbbf3419.js.map